package com.rlyy.rsj.service.user;

import com.rlyy.aibase.utils.base.MapNode;
import com.rlyy.rsj.dao.UserDao;
import com.rlyy.rsj.entity.ReceiveUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author : shibixiao
 * @description :
 * @date : 2021-07-21 14:44
 **/
@Component
public class UserServiceImpl implements IUserService{

    @Autowired
    private UserDao userDao;
    /**
     * 获取接收用户
     *
     * @param userId 用户id
     * @return {@link ReceiveUser}
     */
    @Override
    public ReceiveUser getReceiveUserById(String userId) {
        MapNode user = userDao.queryBaseInfoByUser(userId);
        if(user.size()<=0){
            return null;
        }
        return new ReceiveUser(userId,user.getValue("User_Name"),user.getValue("User_Uname"),
                user.getValue("User_Email"));
    }
}
